package com.vancouver.knows.business.tracker;

import com.pangu.task.IResultReceiver;
import com.pangu.task.OperateResult;
import com.vancouver.knows.business.BusinessModule;
import com.vancouver.knows.business.Constants;
import com.vancouver.knows.business.task.mark.UserDeleteArticleTaskMark;

/**
 * 用户删除文章
 * 
 * @author chenxunlin01
 * 
 */
public class UserDeleteArticleTracker extends ABInvokeTracker {

	public UserDeleteArticleTracker(BusinessModule module, IResultReceiver resultReceiver) {
		super(module, resultReceiver);
	}

	@Override
	public String TAG() {
		return UserDeleteArticleTracker.class.getSimpleName();
	}

	@Override
	public void handleResult(OperateResult result) {
		UserDeleteArticleTaskMark taskMark = (UserDeleteArticleTaskMark) result.getTaskMark();
		String postId = taskMark.getPostId();
		module.getCacheManager().getCityNewsDetailInfoMap().remove(postId);
		module.getCacheManager().getCityNewsInfoCache().removeItemFromIds(postId);
		module.getCacheManager().getMyArticleCache().removeItemFromIds(postId);

		imContext.handleMobEmptyMessage(Constants.BUSINESS_STATUS_USER_DEL_ARTICLE);
	}
}
